package com.enjoyor.soa.traffic.core.efoms.mapper.impl;

import com.enjoyor.soa.traffic.core.efoms.constant.DeviceWranInfoSqlId;
import com.enjoyor.soa.traffic.core.efoms.domain.DeviceStatusInfo;
import com.enjoyor.soa.traffic.core.efoms.domain.DeviceWranInfo;
import com.enjoyor.soa.traffic.core.efoms.mapper.IDeviceWranInfoMapper;
import com.enjoyor.soa.traffic.frame.constant.BaseSqlId;
import com.enjoyor.soa.traffic.frame.support.mybatis.mapper.impl.BaseMapper;
import com.enjoyor.soa.traffic.util.pojo.Page;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DeviceWranInfoMapper extends BaseMapper<DeviceWranInfo> implements IDeviceWranInfoMapper {

	@Override
    public List<DeviceWranInfo> selectDeviceWranInfoList(Map<String, Object> map){
    	return sqlSessionTemplate.selectList(getSqlName(DeviceWranInfoSqlId.SQL_SELECT_LIST), map);
    }
	
	@Override
    public List<DeviceWranInfo> selectDeviceWranRealList(Map<String, Object> map){
    	return sqlSessionTemplate.selectList(getSqlName(DeviceWranInfoSqlId.SQL_SELECT_REAL_LIST), map);
    }
	
	@Override
    public List<DeviceWranInfo> selectDeviceWranHisList(Map<String, Object> map){
    	return sqlSessionTemplate.selectList(getSqlName(DeviceWranInfoSqlId.SQL_SELECT_HIS_LIST), map);
    }
	
	@Override
	public Page selectDeviceWranRealPage(Page page) {
		// TODO Auto-generated method stub
		return this.selectPageInfo(getSqlName(DeviceWranInfoSqlId.SQL_SELECT_REAL_LIST), page);
	}
	
	@Override
	public Page selectDeviceWranHisPage(Page page) {
		// TODO Auto-generated method stub
		return this.selectPageInfo(getSqlName(DeviceWranInfoSqlId.SQL_SELECT_HIS_LIST), page);
	}
	
	@Override
    public int insertWranHis(DeviceWranInfo deviceWranInfo){
		return sqlSessionTemplate.insert(getSqlName(DeviceWranInfoSqlId.SQL_INSERT_WRAN_HIS), deviceWranInfo);
    }

	@Override
    public int updateTimeSelective(DeviceWranInfo deviceWranInfo){
		return sqlSessionTemplate.update(getSqlName(DeviceWranInfoSqlId.SQL_UPDATE_WRAN_TIME), deviceWranInfo);
    }
}
